import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'layout',
    component: () => import('@/layout'),
    redirect: '/index',
    children: [
      { path: '/index', component: () => import('@/views/home-page/index.vue') },
      { path: '/agents', component: () => import('@/views/agents/index.vue') },
      { path: '/category', component: () => import('@/views/category/index.vue') },
      { path: '/about', component: () => import('@/views/about/index.vue') },
      { path: '/detail/:id', component: () => import('@/views/house-detail/index.vue') }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
